There is a demand for increased voice quality in communications technology. Increasing voice bandwidth is one method of improving voice quality. Generally, bandwidth is increased by using a bandwidth extension technology, and the bandwidth extension technology includes a time domain bandwidth extension technology and a frequency domain bandwidth extension technology.
In the time domain bandwidth extension technology, a packet loss rate is a key factor that affects signal quality. In a case of packet loss, a lost frame needs to be restored as accurately as possible. A decoder side determines, by parsing bitstream information, whether frame loss occurs. If frame loss does not occur, normal decoding processing is performed. If frame loss occurs, frame loss processing needs to be performed.
When frame loss processing is performed, the decoder side obtains a high frequency band signal according to a decoding result of a previous frame, and performs gain adjustment on the high frequency band signal by using a set subframe gain and a global gain that is obtained by multiplying a global gain of the previous frame by a fixed attenuation factor, to obtain a final high frequency band signal.
The subframe gain used during frame loss processing is a set value, and therefore a spectral discontinuity phenomenon may occur, resulting in that transition before and after frame loss is discontinuous, a noise phenomenon appears during signal reconstruction, and speech quality deteriorates.